package com.ogilvy.audi.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ogilvy.audi.bean.Comment;
import com.ogilvy.audi.dao.CommentDao;
import com.ogilvy.audi.service.CommentService;
import com.ogilvy.frame.page.PageTools;
import com.ogilvy.frame.service.BaseServiceImpl;

@Service
public class CommentServiceImpl extends BaseServiceImpl implements CommentService{
	@Autowired
	CommentDao commentDao;
	public PageTools<Comment> query(){
		return null;
	}
	public PageTools<Comment> query(int pageNo, int pageSize,Map<String,Object> condition){
		return commentDao.selectAll(pageNo,pageSize,condition);
	}
	public PageTools<Comment> query(Map<String,Object> condition){
		return commentDao.selectAll(condition);
	}
	public Comment add(Comment comment){
		Comment comment_ = commentDao.save(comment);
		return comment_!=null?comment:null;
	}
	public boolean del(Integer commentId){
		Comment comment_ = commentDao.deleteById(commentId);
		return comment_!=null?true:false;
	}
	
}
